{{extend "base.html"}}

{{block head}}
<script type="text/javascript">
	var submitForm = function($dialog, $grid, $pjq, $mainMenu) {
		if ($('form').form('validate')) {
			var url;
			url = '/myrbac/permissionsave';
			$.post(url, sy.serializeObject($('form')), function(result) {
				if (result.success) {
					$grid.treegrid('reload');
					$dialog.dialog('destroy');
				} else {
					$pjq.messager.alert('提示', result.msg, 'error');
				}
			}, 'json');
		}
	};
</script>
{{end}}

{{block content}}
<form method="post" class="form">
		<fieldset>
			<legend>权限基本信息</legend>
			<table class="tableForm">
				<tr>
					<th style="width: 80px;">权限名称</th>
					<td><input name="name" class="easyui-validatebox" data-options="required:true" style="width:250px;"/></td>
				</tr>
				<tr>
					<th>权限路径</th>
					<td><input name="url" style="width:250px;"/></td>
				</tr>
				<tr>
					<th>权限类型</th>
					<td><select name="resourcetype" class="easyui-combobox" data-options="
								required:true,
								editable:false,
								valueField:'id',
								textField:'resourcetype_name',
								url:'/myrbacpost/resourcetypeinfo',
								panelHeight:'auto'
							" style="width: 155px;"></select></td>
				</tr>
				<tr>
					<th>上级权限</th>
					<td><select id="pid" name="pid" 
							class="easyui-combotree" data-options="
											editable:false,
											idField:'id',
											textField:'text',
											parentField:'pid',
											url:'/myrbacpost/permissioninfo'
									" style="width: 155px;">
						</select>
						<a href="javascript:void(0);" onclick="$('#pid').combotree('clear');"><span class="ext-icon-cross" title="清空" style="display:inline-block;vertical-align:middle;width:16px;height:16px;"></span></a>
						</td>
				</tr>
				<tr>
					<th>权限描述</th>
					<td><textarea name="description" style="width:250px;"></textarea></td>
				</tr>
			</table>
		</fieldset>
	</form>
{{end}}